Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering railway pattern on z12 #3488

Merged
merged 1 commit into from
Nov 30, 2018

Conversation

kocio-pl
Copy link
Collaborator

@kocio-pl kocio-pl commented Nov 1, 2018

Related to #3467.

Changes proposed in this pull request:

  • Rendering railway pattern on z12 instead of a simple black line. It allows to recognize railways from tram lines in urban areas and makes it easier to recognize them in the outdoor (we show power lines later, but one does not have to know that).

Test rendering with links to the example places:

Bratislava

screenshot_2018-11-01 openstreetmap carto kosmtik
screenshot_2018-11-01 openstreetmap carto kosmtik 1

Amsterdam

screenshot_2018-11-01 openstreetmap carto kosmtik 6
screenshot_2018-11-01 openstreetmap carto kosmtik 7

Zagreb

screenshot_2018-11-01 openstreetmap carto kosmtik 2
screenshot_2018-11-01 openstreetmap carto kosmtik 3

Bytom

screenshot_2018-11-01 openstreetmap carto kosmtik 4
screenshot_2018-11-01 openstreetmap carto kosmtik 5

@matkoniecz
Copy link
Contributor

From what I see it is just enabling rendering of a patter, without merging split railway ways.

In my experience (I tested such rendering during road redesign) it leads to a poor results where railway lines are split into many small segments (for example due to bridges or in places where people tagged changing maximum allowed speed on railways).

On this examples it is not as bad as remember (maybe Kraków where it was certainly noticeable has more split railways than other places?), but still noticeable.

selection_005

@kocio-pl
Copy link
Collaborator Author

kocio-pl commented Nov 1, 2018

For me this problem is small (I would not notice it if you haven't shown it), but gains should be obvious. Split ways are bigger issue for road labels (names and shields are sometimes located on the edges, where the road splits into "connectors"), but even there it's not severe.

Cracow example looks great to me:

screenshot_2018-11-01 openstreetmap carto kosmtik 8

@matkoniecz
Copy link
Contributor

matkoniecz commented Nov 1, 2018

Artifacts (short/missing black parts) are also visible but the problem is lesser than I remember.

Maybe I tested it on z11? Or with longer dashes?

@kocio-pl
Copy link
Collaborator Author

kocio-pl commented Nov 1, 2018

Cracow example on z11 looks also good:

screenshot_2018-11-01 openstreetmap carto kosmtik 9

@matthijsmelissen
Copy link
Collaborator

This resolves part of #1704

@kocio-pl
Copy link
Collaborator Author

kocio-pl commented Nov 1, 2018

Thanks for reminding, I have completely forgotten about it!... 😄

Here I would want to do it at least for z11, z12 for railway=rail without tunnel=yes.

I've tried to fix the obvious problem here (trams vs. trains), which exists only on z12. However with this small pattern it might work on z11 too, probably with a bit faded color (z11 areas are also a bit muted and there is less other objects, so railways could be too visible then).

The technique is to use ST_LineMerge
This comes with a few issues

  • The SQL is more complicated

I'm afraid of that. We can't afford getting rid of SQL for performance reasons, but given that roads code is already hard to maintain and was meant to be cleaned, I don't think it's safe.

  • It is slower

It depends how much slower.

  • It involves linestrings that differ depending on bounding box, resulting in artifacts at MT edges
    Because we don't label railways, I don't think the MT edge problems matter here.

We already have railway labels, so this should be tested.

From what I see on test images, I don't feel glitches are big enough to try any workarounds. Maybe smaller pattern make them less visible than the pattern used on z12+? My goal was to make it small enough to not dominate everything around, and the result is that the pattern is there, but not anything above it, so probably glitches are also harder to be found.

@kocio-pl kocio-pl merged commit dac3fbc into gravitystorm:master Nov 30, 2018
@kocio-pl kocio-pl deleted the rail-pattern-z11 branch November 30, 2018 23:43
@matkoniecz
Copy link
Contributor

Cracow example on z11 looks also good:

For me glitches directly below "Kraków" label, on track below and toward right from city label (black parts are almost completely gone) are significant at z11.

There are also other quite significant glitches.

@kocio-pl
Copy link
Collaborator Author

kocio-pl commented Dec 1, 2018

BTW - after your comments I have also found glitches on current rendering, so this looks like general problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants